<script type="text/javascript">
function ajaxFileUpload(pid) {
	$.ajaxFileUpload({
		url:'index.php?c=zy_mc_allocation&m=updateFile&allocation_id='+pid,
		secureuri:false,
		fileElementId:'file_name',
		dataType: 'json',
		success: function (data) {
			if(data.code == 1){
				alert('上传成功');
				location=location;
			}else{
				alert('上传失败');
			}
		}
	})
}
</script> 
<h2 class="title">设备调拨</h2>
<table class="tb_term" width="100%">
<tr>
	<td class="tr_td_width01 alignright">调拨单据编号</td>
	<td class="tr_td_width03"><input type=text class="input_browse_stand txt-normal" name="allocation_no" value='{%$allocation_no%}' readonly></td>
	<td class="alignright">设备调拨出处</td>
	<td>
		<select name="allocation_from"  class="select_edit02 txt-normal" dataType="Require"  msg="" {% if $act eq 'edit' %}readonly{%/if%}>
			<option value="{%$list%}">{%$allocation_from%}</option>
		</select>
	</td>
</tr>
<tr>	
	<td class="alignright">设备调拨日期</td>
	<td>
		<input type=text class="input_date_browse txt-normal" name="transfer_time" id="allocation_time" maxlength="12" value='{%$allocation_time|date_format:"%Y-%m-%d"%}' readonly>
	</td>
	<td class="alignright">设备调拨去向</td>
	<td>
		<select name="allocation_to"  class="select_edit02 txt-normal" dataType="Require"  msg="" {% if $act eq 'edit' %}readonly{%/if%}>

			<option value="{%$list%}">{%$allocation_to%}</option>

		</select>
	</td>
</tr>
<tr>	
	<td class="alignright">调拨经办人员</td>
	<td colspan="3">
		<select name="admin_user_id" class="select_edit txt-normal" readonly>
			{%html_options options=$admin_info selected=$admin_user_id%}
		</select>
	</td>
</tr>
<tr>
	<td class="alignright">设备调补附件</td>
	<td colspan="3">
		<div  class="wrap_accessory">
			<input type="file" name="file_path" id="file_name" size="50" class="input_upload txt-normal"  />
			<input type="button"  class="input_submit txt-normal" value="提交" onclick="ajaxFileUpload({%$allocation_id%})"/>
			{%if $file_path%}
			<label class="brower_download"><a href='{%$upload_file_path%}{%format_c c=$smarty.get.c%}{%$file_path%}' target="_blank">下载</a></label>
			{%/if%}
		</div>
	</td>
</tr>
<tr>
	<td class="alignright">调拨单据备注</td>	
	<td colspan="3"><textarea rows="3" class="textarea_browse txt-normal" readonly>{%$allocation_info%}</textarea></td>
</tr>
</table>
<p class="btn_right">	
	<button type="button" class="b-default" hidefocus="true" onclick="javascript:location.href='index.php?c=zy_allocation_log&m=add&allocation_id={%$allocation_id%}&contract_no={%$contract_no%}'"><span><em>调拨</em></span></button>	
	<button type="button" class="b-default" hidefocus="true" onclick="javascript:location.href='index.php?c=zy_mc_allocation'"><span><em>返回</em></span></button>
</p>

<div class="title_box">
	<div class="title_txt">调拨设备明细</div>
	<div class="find_bar">
		<form name="form_find" method="get" action="">
		<label class="find_name">设备名称</label>
		<input type="text" class="input_find" maxlength="50" name="cn_name" value="{%$smarty.get.cn_name%}">
		<input type="hidden" name="allocation_id" value="{%$smarty.get.allocation_id%}">
		<input type="hidden" name="m" value="{%$smarty.get.m%}">
		<input type="hidden" name="c" value="{%$smarty.get.c%}">
		<!--<button type="submit" class="b-default" hidefocus="true"><span><em>查询</em></span></button>-->	
		<label class="find_btn" onclick="javascript:form_find.submit();"> 查询</label>
		</form>
	</div>
</div>

<table class="tb_list" width="100%">
<tr class="title">
	<td class="list_td_zw_10">设备自编号</td>
	<td class="list_td_zw_10">财务编号</td>
	<td class="list_td_zw_10">中文名称</td>
	<td>规格型号</td>
	<td class="list_td_zw_10">厂家编号</td>
	<!--<td width="20%">调拨数量</td>-->
	<td class="list_date02">首次启用时间</td>
	<td class="list_td_zw_04">设备状态</td>
	<td class="list_td_zw_opt01">操作</td>
</tr>
{%foreach item=list from=$recordArr name="rec"%}
<tr>
	<td class="alignleft">{%$list.mc_self_no%}</td>
	<td class="alignleft">{%$list.finance_no%}</td>
	<td class="alignleft">{%$list.mc_cn_name%}</td>
	<td class="alignleft" title="{%$list.mc_model%}">{%$list.mc_model%}</td>
	<td class="alignleft">{%$list.comp_no%}</td>
	<!--<td>{%$list.allocation_no%}</td>-->	
	<td>{%$list.start_time|date_format:"%Y-%m-%d"%}</td>
	<td>{%if $list.mstate eq 1%}完好{%else%}破损{%/if%}</td>	
	<td>
		<a href='index.php?c=zy_allocation_log&m=del&allocation_log_id={%$list.allocation_log_id%}&allocation_id={%$smarty.get.allocation_id%}' onclick="return confirm('您确认删除吗?')">删除</a>
	</td>
</tr>
{%foreachelse%}
<tr><td colspan="8">暂无内容</td></tr>
{%/foreach%}
</table>
<div class="pagenation aligncenter">
{%$page_footer%}
</div>